package com.cx.algrithm.binary_tree.binary_search_tree.red_black_tree;

/**
 * @Author: robert.song
 * @Date: Created in 2022/3/16
 */
public class TreeOperation {

    public static void show(RBTree.RBNode root) {
        traverse(root);
    }

    //    中序遍历
    public static void traverse(RBTree.RBNode rbNode) {
        RBTree.RBNode left, parent, right;
        if ((left = rbNode.getLeft()) != null) {
            traverse(left);
        }
        System.out.println(rbNode.getValue());
        if ((right = rbNode.getRight()) != null) {
            traverse(right);
        }
    }
}
